package com.chinasoft.mall.framework;

import java.util.ArrayList;
import java.util.List;
import java.util.Observable;
import java.util.Timer;
import java.util.TimerTask;
import java.util.Vector;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.util.Log;

import com.chinasoft.mall.model.BaseBean;
import com.chinasoft.mall.model.response.GetGameBean.Data;


/**
 * 每一秒钟刷新一次的定时处理器
 * @author Administrator
 */
public class OrderGoods  extends Observable {
	
	public static List<Data> goodsids=new Vector<Data>();
	public static List<Data> goodsids_bg=new ArrayList<Data>();
	public static List<String> prompt_bg=new ArrayList<String>();
//	private static boolean isCancle;
	private static OrderGoods _tu;
	private static Context ctx;
	private OrderGoods(Context ctx){
		Log.i("OrderGoods", "开始！！");
		
		this.ctx = ctx;
		
//		SharedPreferences mSharedPreferences = ctx.getSharedPreferences("switch", Context.MODE_PRIVATE);    
//		Editor editor = mSharedPreferences.edit();           
//		editor.putBoolean("value", false);
//		editor.commit();
//		SharedPreferences mSharedPreferences = ctx.getSharedPreferences("switch", Context.MODE_PRIVATE);
//		isCancle = mSharedPreferences.getBoolean("value", false);
	}
	
	public static OrderGoods init(Context ctx) {
		synchronized (OrderGoods.class) {
			if (_tu == null) {
				_tu = new OrderGoods(ctx);
			}
		}
		return _tu;
	}
	
	public static void setState(boolean flag){
//		isCancle = !flag;
		setBooleanValue(flag);
	}
	
	private static void setBooleanValue(Boolean isCancel){
		SharedPreferences mSharedPreferences = ctx.getSharedPreferences("switch", Context.MODE_PRIVATE);    
		Editor editor = mSharedPreferences.edit();           
		editor.putBoolean("value", isCancel);
		editor.commit();
	}
	

}
